﻿using System;
using System.Collections.Generic;

namespace Region.Utils
{    
    public partial class Export
    {        
        static public bool export(String Format,Byte[] Template,String OutFile,Dictionary<String, Object> Poles,Dictionary<String,List<Dictionary<String, Object>>> Tables, TaskManager.Task task = null)
        {
            Format = Format.ToUpper();
            Export Doc = null;
            if (Format == "RTF") Doc = new ExportRTF();
            //else if (Format == "ExcelXML") Doc = new ExportExcelXML();
            else if (Format == "DOCX") Doc = new ExportDOCX();
            else if (Format == "XLSX") Doc = new ExportXLSX();
            Doc.Template = Template;
            Doc.OutFile = OutFile;
            Doc.Poles = Poles;
            Doc.Tables = Tables;
            return Doc.Save(task);
           
        }
    }    
}